package com.wolf.cx330.camera

import android.content.Context
import android.hardware.camera2.CameraManager
import android.os.Bundle
import android.view.SurfaceHolder
import androidx.appcompat.app.AppCompatActivity
import com.wolf.cx330.R
import kotlinx.android.synthetic.main.act_camera2.*

class Camera2Act : AppCompatActivity() {
    private lateinit var cameraManager: CameraManager
    private lateinit var surfaceHolder: SurfaceHolder
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.act_camera2)
        cameraManager = getSystemService(Context.CAMERA_SERVICE) as CameraManager
        surfaceHolder = surfaceView.holder
        surfaceHolder.addCallback(object : SurfaceHolder.Callback {
            override fun surfaceChanged(
                holder: SurfaceHolder?,
                format: Int,
                width: Int,
                height: Int
            ) {

            }

            override fun surfaceDestroyed(holder: SurfaceHolder?) {

            }

            override fun surfaceCreated(holder: SurfaceHolder?) {
                initCameraAndPreView()
            }

        })
    }

    private fun initCameraAndPreView() {


    }
}